<?php
// $Id: views-view.tpl.php,v 1.9 2008/04/16 18:50:49 merlinofchaos Exp $
/**
 * @file views-view.tpl.php
 * Main view template
 *
 * Variables available:
 * - $header: The view header
 * - $footer: The view footer
 * - $rows: The results of the view query, if any
 * - $empty: The empty text to display if the view is empty
 * - $pager: The pager next/prev links to display, if any
 * - $exposed: Exposed widget form/info to display
 * - $feed_icon: Feed icon to display, if any
 * - $more: A link to view more, if any
 * - $admin_links: A rendered list of administrative links
 * - $admin_links_raw: A list of administrative links suitable for theme('links')
 *
 * @ingroup views_templates
 */
?>
<div class="view view-<?php print $css_name; ?> view-id-<?php print $name; ?> view-display-id-<?php print $display_id; ?>">

  <?php if ($admin_links): ?>
    <div class="views-admin-links views-hide">
      <?php print $admin_links; ?>
    </div>
  <?php endif; ?>

<?php

// if ($_GET['page'] == NULL && arg(1) !== 'term') {
//   drupal_set_title('');
// } 
/*
 if (arg(0) == 'toimetus') {
   $tid = 1823;
 } 
  
 if (arg(1) == 'term') {
 
   $tid = arg(2);
  
   drupal_set_breadcrumb(_trip_breadcrumb_get_breadcrumb($tid));
   
   $subterms = taxonomy_get_children($tid);

   if ($subterms) { 

     foreach ($subterms as $subterm) {
       $subterm_links[] = array(
         'title' => $subterm->name, 
         'href' => 'taxonomy/term/'. $subterm->tid
         );
     }
     print theme('links', $subterm_links, array('class' => 'links'));
   
   }

}
*/ 
?>    

  <?php if ($header): ?>
    <div class="view-header">
      <?php print $header; ?>
    </div>
  <?php endif; ?>

  <?php if ($exposed): ?>
    <div class="view-filters">
      <?php print $exposed; ?>
    </div>
  <?php endif; ?>

  <?php if ($attachment_before && $_GET['page'] == NULL): ?>
    <div class="attachment-before">
      <?php print $attachment_before; ?>
    </div>
  <?php endif; ?>
  <div class="forum-add">  
<?php
/*  
  if (user_access('create trip_forum content')) {
//    print l(t('Add forum post'), 'node/add/trip-forum' . ($tid ? '/' . $tid : NULL), array('query' => array('destination' => drupal_get_destination()))); 
    print l(t('Add forum post'), 'node/add/trip-forum' . ($tid ? '/' . $tid : NULL), array('query' => drupal_get_destination())); 
  } else {
    print t('You need to !a or !b to post forum topics', array('!a' => l(t('to log in'), 'user', array('query' => drupal_get_destination())), '!b' => l(t('to create an account'), 'user/register')));
  }
*/
?>
  </div>
  
  <?php if ($rows): ?>
    <div class="view-content">
      <?php  print $rows; ?>
    </div>
  <?php elseif ($empty): ?>
    <div class="view-empty">
      <?php print $empty; ?>
    </div>
  <?php endif; ?>

  <?php if ($pager): ?>
    <?php print $pager; ?>
  <?php endif; ?>

  <?php if ($attachment_after): ?>
    <div class="attachment-after">
      <?php print $attachment_after; ?>
    </div>
  <?php endif; ?>

  <?php if ($more): ?>
    <?php print $more; ?>
  <?php endif; ?>

  <?php if ($footer): ?>
    <div class="view-footer">
      <?php print $footer; ?>
    </div>
  <?php endif; ?>

  <?php if ($feed_icon): ?>
    <div class="feed-icon">
      <?php print $feed_icon; ?>
    </div>
  <?php endif; ?>

</div> <?php // class view ?>
